package com.yy.wga.goods.feign.api;


import com.yy.wga.common.core.dto.PageBean;
import com.yy.wga.common.core.dto.Result;
import com.yy.wga.goods.feign.request.ResourceGoodsCategoryReq;
import com.yy.wga.goods.feign.response.GetAllCategoryGoodsResp;
import com.yy.wga.goods.feign.response.GetHeadSupplierGoodsResponse;
import com.yy.wga.goods.feign.response.GetPageCategoryGoodsResp;
import com.yy.wga.goods.feign.response.GetResourceGoodsCategoryResponse;
import com.yy.wga.goods.feign.response.GoodsInfoResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

@FeignClient(name = "ResourceGoodsCategoryFeign",
        url = "https://wga-api.xianrcj.com/api/wechat/mp/",
        path = "/api/goods/goods/category")
public interface ResourceGoodsCategoryFeign {

    /**
     * 添加分类
     * @param request
     * @return
     */
    @PostMapping(value = "/addCategory")
    Result<Void> addCategory(@RequestBody @Valid ResourceGoodsCategoryReq.AddCategory request);

    /**
     * 更新分类
     * @param request
     * @return
     */
    @PostMapping(value = "/updateCategory")
    Result<Void> updateCategory(@RequestBody @Valid ResourceGoodsCategoryReq.UpdateCategory request);

    /**
     * 删除分类
     * @param request
     * @return
     */
    @PostMapping(value = "/deleteCategory")
    Result<Void> deleteCategory(@RequestBody @Valid ResourceGoodsCategoryReq.DeleteCategory request);

    /**
     * 查看所有品类
     * @return
     */
    @GetMapping(value = "/listCategory")
    Result<List<GetResourceGoodsCategoryResponse>> listCategory();

    /**
     * 分类排序
     * @param request
     * @return
     */
    @PostMapping(value = "/sortCategory")
    Result<Void> sortCategory(@RequestBody @Valid ResourceGoodsCategoryReq.SortCategory request);

    /**
     * 更改分类状态
     * @param request
     * @return
     */
    @PostMapping(value = "/changeCategoryStatus")
    Result<Void> changeCategoryStatus(@RequestBody @Valid ResourceGoodsCategoryReq.ChangeCategoryStatus request);

    /**
     * 更改首页展示状态
     * @param request
     * @return
     */
    @PostMapping(value = "/changeHomepageDisplay")
    Result<Void> changeHomepageDisplay(@RequestBody @Valid ResourceGoodsCategoryReq.ChangeHomepageDisplay request);

    /**
     * 修改首页是否支持每单补贴佣金格式
     * @param request
     * @return
     */
    @PostMapping(value = "/changeSupportSubsidyAmount")
    Result<Void> changeSupportSubsidyAmount(@RequestBody @Valid ResourceGoodsCategoryReq.ChangeSupportSubsidyAmount request);

    /**
     * 添加分类下的商品
     * @param request
     * @return
     */
    @PostMapping(value = "/addGoods")
    Result<Void> addGoods(@RequestBody @Valid ResourceGoodsCategoryReq.AddGoods request);

    /**
     * 删除分类下的商品
     * @param request
     * @return
     */
    @PostMapping(value = "/deleteGoods")
    Result<Void> deleteGoods(@RequestBody @Valid ResourceGoodsCategoryReq.DeleteGoods request);

    /**
     * 分页查看分类下的商品
     * @param request
     * @return
     */
    @PostMapping(value = "/pageGoods")
    Result<PageBean<GetPageCategoryGoodsResp>> pageGoods(@RequestBody @Valid ResourceGoodsCategoryReq.PageGoods request);

    /**
     * 分页查看分类下的商品
     * @param request
     * @return
     */
    @PostMapping(value = "/allGoods")
    Result<List<GetAllCategoryGoodsResp>> allCategoryGoods(@RequestBody @Valid ResourceGoodsCategoryReq.AllGoods request);

    /**
     * 分类下的商品排序
     * @param request
     * @return
     */
    @PostMapping(value = "/sortGoods")
    Result<Void> sortGoods(@RequestBody @Valid ResourceGoodsCategoryReq.SortGoods request);

    /**
     * 设置商品推荐理由
     * @param request
     * @return
     */
    @PostMapping(value = "/setRecommendReason")
    Result<Void> setRecommendReason(@RequestBody @Valid ResourceGoodsCategoryReq.SetRecommendReason request);

    /**
     * 设置商品补贴金额
     * @param request
     * @return
     */
    @PostMapping(value = "/setSubsidyAmount")
    Result<Void> setSubsidyAmount(@RequestBody @Valid ResourceGoodsCategoryReq.SetSubsidyAmount request);

    /**
     * 获取微信后台合作商品
     * @param request
     * @return
     */
    @PostMapping(value = "/getHeadSupplierGoods")
    Result<GetHeadSupplierGoodsResponse> getHeadSupplierGoods(@RequestBody @Valid ResourceGoodsCategoryReq.GetHeadSupplierGoodsReq request);

    /**
     * 获取微信后台合作商品V2
     * @param request
     * @return
     */
    @PostMapping(value = "/getHeadSupplierGoodsV2")
    Result<PageBean<GoodsInfoResp>> getHeadSupplierGoodsV2(@RequestBody @Valid ResourceGoodsCategoryReq.GetHeadSupplierGoodsReqV2 request);

}
